const { execSync } = require("child_process");

const now = new Date();
const year = now.getFullYear();
const month = now.getMonth() + 1;
const date = now.getDate();
const hour = now.getHours();
const minutes = now.getMinutes();
const second = now.getSeconds();

// 打包时间
const builtTime = `${year}-${month}-${date} ${hour}:${minutes}:${second}`;

// 打包分支
const currentGitBranch = execSync("git rev-parse --abbrev-ref HEAD")
  .toString()
  .trim();

module.exports = {
  builtTime,
  currentGitBranch,
};
